import {Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn} from "typeorm";
import {ApiProperty} from "@nestjs/swagger";
// import {EditorType} from "../../../common/enums/common.enum";

@Entity('sys_tags')
export class BlogTagsEntity {
	@PrimaryGeneratedColumn({ type: 'bigint' })
	id: number

	@Column({ type: 'int', name: 'editor_type', comment: '内容类型' })
	editorType: number

	@Column({ type: 'char',length:200, name: 'tag_name', comment: '标签名' })
	tagName: string

	@Column({ type: 'longtext', name: 'tag_desc', comment: '标签描述' })
	tagDesc: string

	@Column({ type: 'varchar',length:500, name: 'tag_img', comment: '标签描述图片' })
	tagImg: string

	@Column({ type: 'boolean', name: 'enable', comment: '是否可用' })
	enable: boolean

	@CreateDateColumn({ type: 'timestamp', name: 'create_date', comment: '创建时间',
		precision: 0,default:()=>'CURRENT_TIMESTAMP(0)'})
	@ApiProperty({ description: '创建时间' })
	createDate: Date

	@UpdateDateColumn({ type: 'timestamp', name: 'update_date', comment: '更新时间',
		precision: 0,default:()=>'CURRENT_TIMESTAMP(0)',onUpdate:'CURRENT_TIMESTAMP'
	})
	@ApiProperty({ description: '更新时间' })
	updateDate: Date
}
